// router/index.js
import { createRouter, createWebHistory } from 'vue-router';
//导入组件
import Login from '../views/Login.vue';
import Index from '../views/index.vue';

const routes = [
    { 
        path: '/', 
        redirect: '/login'
    },
    { 
        path: '/login', 
        component: Login 
    },
    {
        path: '/index',
        name: 'Index',
        component: () => import('../views/index.vue')
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes: routes
});

export default router;